using System.Web.Mvc;
using Complaint.Models;

namespace Complaint.Controllers
{
    public class CategoryController : Controller
    {
        //
        // GET: /Category/

        public ActionResult Index()
        {
            using (new UnitOfWorkScope(false))
            {
                var model = new CategoryModel();

                if (Request.IsAjaxRequest())
                    return PartialView("ListCategories", model.GetCategoryHierarchy(null));

                return View(model.GetCategoryHierarchy(null));
            }
        }
    }
}
